<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<c:set var="nature_value"><x:out select="$xmlData/data/organizations/organization[@submit_org='1']/nature_value" /></c:set>
<c:set var="grant_code"><x:out select="$xmlData/data/proposal/grant_code" /></c:set>
<c:set var='stat_year'>${param.statyear }</c:set>
<c:set var='curr_year'>${param.curryear }</c:set>
<div class="t_bar">${param.title3 }</div>
<input type="hidden" id="yanfa_income" name="finances/yanfa_income" value="<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=5]/yanfa_income" />" />
<input type="hidden" id="income_main" name="finances/income_main" value="<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=5]/income_main" />" />
<c:choose>
	<c:when test="${fn:substring(nature_value,0,1) eq 'A'}">
		<table class="t_css table01" width="100%" border="0" cellpadding="0" id="orgFinanceInfo" cellspacing="1">
			<col style="width:30%"/>
			<col style="width:20%"/>
			<col style="width:30%"/>
			<col style="width:20%"/>
			<tr>

				<td align="right" nowrap>上年固定资产总额（万元）：</td>
				<td align="center">
			<span name="finances/assets_fixed_cost">
			<c:if test="${stat_year eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=5]/assets_fixed_cost" />
			</c:if>
			<c:if test="${stat_year+1 eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=3]/assets_fixed_cost" />
			</c:if>
			<c:if test="${stat_year+2 eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=2]/assets_fixed_cost" />
			</c:if>
		    </span>
				</td>
				<td align="right" nowrap>上年资产负债率（%）：</td>
				<td align="center">
			<span name="finances/asset_liability_ratio">
				<c:if test="${stat_year eq curr_year }">
					<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=5]/asset_liability_ratio" />
				</c:if>
				<c:if test="${stat_year+1 eq curr_year }">
					<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=3]/asset_liability_ratio" />
				</c:if>
				<c:if test="${stat_year+2 eq curr_year }">
					<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=2]/asset_liability_ratio" />
				</c:if>
		    </span>
				</td>
			</tr>
			<tr>
				<td align="right" nowrap>上年研发加计扣除减免税（万元）：</td>
				<td align="center">
			<span name="finances/relief_fax_income_yanfa">
			<c:if test="${stat_year eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=5]/relief_fax_income_yanfa" />
			</c:if>
			<c:if test="${stat_year+1 eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=3]/relief_fax_income_yanfa" />
			</c:if>
			<c:if test="${stat_year+2 eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=2]/relief_fax_income_yanfa" />
			</c:if>
		    </span>
				</td>
				<td align="right" nowrap>上年高新技术企业减免税（万元）：</td>
				<td align="center">
			<span name="finances/relief_fax_income_reduce">
			<c:if test="${stat_year eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=5]/relief_fax_income_reduce" />
			</c:if>
			<c:if test="${stat_year+1 eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=3]/relief_fax_income_reduce" />
			</c:if>
			<c:if test="${stat_year+2 eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=2]/relief_fax_income_reduce" />
			</c:if>
		    </span>
				</td>
			</tr>
			<tr>

				<td align="right" nowrap>上年营业（销售）收入（万元）：</td>
				<td align="center">
			<span name="finances/income" id="total_income">
			<c:if test="${stat_year eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=5]/income" />
			</c:if>
			<c:if test="${stat_year+1 eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=3]/income" />
			</c:if>
			<c:if test="${stat_year+2 eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=2]/income" />
			</c:if>
		    </span>

				</td>
				<td align="right" >上年实际上缴税费总额（万元）：</td>
				<td align="center">
			<span name="finances/fax">
			<c:if test="${stat_year eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=5]/fax" />
			</c:if>
			<c:if test="${stat_year+1 eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=3]/fax" />
			</c:if>
			<c:if test="${stat_year+2 eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=2]/fax" />
			</c:if>
		    </span>
				</td>
			</tr>
			<tr>
				<td align="right">上年减免税总额（万元）：</td>
				<td align="center">
			<span name="finances/relief_reduction_total">
			<c:if test="${stat_year eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=5]/relief_reduction_total" />
			</c:if>
			<c:if test="${stat_year+1 eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=3]/relief_reduction_total" />
			</c:if>
			<c:if test="${stat_year+2 eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=2]/relief_reduction_total" />
			</c:if>
		    </span>
				</td>
				<td align="right" >上年研发经费支出总额（万元）：</td>
				<td align="center">
			<span name="finances/yanfa_income" id="yanfa_income_pay">
			<c:if test="${stat_year eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=5]/yanfa_income" />
			</c:if>
			<c:if test="${stat_year+1 eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=3]/yanfa_income" />
			</c:if>
			<c:if test="${stat_year+2 eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=2]/yanfa_income" />
			</c:if>
		    </span>
				</td>
			</tr>
			<tr>

				<td align="right">其中，上年用于研发的仪器和设备支出（万元）：</td>
				<td align="center">
			<span name="finances/yanfa_instrument" id="income_main">
			<c:if test="${stat_year eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=5]/yanfa_instrument" />
			</c:if>
			<c:if test="${stat_year+1 eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=3]/yanfa_instrument" />
			</c:if>
			<c:if test="${stat_year+2 eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=2]/yanfa_instrument" />
			</c:if>
		    </span>
				</td>
				<td align="right">研发支出占销售收入比重(%)：</td>
				<td align="center">
        			<span name="finances/income_bl" id="income_bl">
        			<c:if test="${stat_year-1 eq curr_year }">
						<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=5]/income_bl" />
					</c:if>
        			<c:if test="${stat_year eq curr_year }">
						<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=3]/income_bl" />
					</c:if>
        			<c:if test="${stat_year+1 eq curr_year }">
						<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=2]/income_bl" />
					</c:if>
        		    </span>
				</td>
				<c:choose>
					<c:when test="${grant_code eq 5939}">
						<td align="right">上年新产品销售收入（万元）：</td>
						<td align="center">
        			<span name="finances/income_sale">
        			<c:if test="${stat_year eq curr_year }">
						<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=5]/income_sale" />
					</c:if>
        			<c:if test="${stat_year+1 eq curr_year }">
						<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=3]/income_sale" />
					</c:if>
        			<c:if test="${stat_year+2 eq curr_year }">
						<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=2]/income_sale" />
					</c:if>
        		    </span>
						</td>
					</c:when>
					<c:when test="${grant_code eq 51  }">
						<td align="right">上年度研发经费占主营业务收入比例（%）：</td>
						<td align="center">
        			<span name="finances/income_bl" id="income_bl">
        			<c:if test="${stat_year eq curr_year }">
						<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=5]/income_bl" />
					</c:if>
        			<c:if test="${stat_year+1 eq curr_year }">
						<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=3]/income_bl" />
					</c:if>
        			<c:if test="${stat_year+2 eq curr_year }">
						<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=2]/income_bl" />
					</c:if>
        		    </span>
						</td>
					</c:when>
				</c:choose>
			</tr>
			<c:if test="${grant_code eq 5939}">
				<tr>
					<td align="right">上年出口总额（万美元）：</td>
					<td align="center">
                <span name="finances/export">
                <c:if test="${stat_year eq curr_year }">
					<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=5]/export" />
				</c:if>
                <c:if test="${stat_year+1 eq curr_year }">
					<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=3]/export" />
				</c:if>
                <c:if test="${stat_year+2 eq curr_year }">
					<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=2]/export" />
				</c:if>
                </span>
					</td>
					<td align="right">上年净利润（万元）：</td>
					<td align="center">
                <span name="finances/proft">
                <c:if test="${stat_year eq curr_year }">
					<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=5]/proft" />
				</c:if>
                <c:if test="${stat_year+1 eq curr_year }">
					<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=3]/proft" />
				</c:if>
                <c:if test="${stat_year+2 eq curr_year }">
					<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=2]/proft" />
				</c:if>
                </span>
					</td>
				</tr>
			</c:if>
		</table>
	</c:when>
	<c:otherwise>
		<table class="t_css table01" width="100%" border="0" cellpadding="0" id="orgFinanceInfo" cellspacing="1">
			<col style="width:20%"/>
			<col style="width:30%"/>
			<col style="width:20%"/>
			<col style="width:30%"/>
			<tr>
				<td align="right" nowrap>上年度支出费用（万元）：</td>
				<td align="center">
			<span name="finances/outcome">
			<c:if test="${stat_year eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=4]/outcome" />
			</c:if>
			<c:if test="${stat_year+1 eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=2]/outcome" />
			</c:if>
			<c:if test="${stat_year+2 eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=1]/outcome" />
			</c:if>
		    </span>
				</td>
				<td align="right" nowrap>上年研发经费支出总额（万元）：</td>
				<td align="center">
			<span name="finances/outcome_reserch">
			<c:if test="${stat_year eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=4]/outcome_reserch" />
			</c:if>
			<c:if test="${stat_year+1 eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=2]/outcome_reserch" />
			</c:if>
			<c:if test="${stat_year+2 eq curr_year }">
				<x:out select="$xmlData/data/organization/finances/finance[@sequence_no=1]/outcome_reserch" />
			</c:if>
		    </span>
				</td>
			</tr>
		</table>
	</c:otherwise>
</c:choose>
<script type="text/javascript">
	$(function() {
		var yanfa_income = $("#yanfa_income_pay").text();
		var total_income = $("#total_income").text();
		var income_bl = $("#income_bl");
		var value1 = "";
		var value = "";
		if(yanfa_income != "undefined" && total_income != "undefined" && income_bl != "undefined") {
			value1 = parseFloat(yanfa_income.replace(/,/g,""));
			value = parseFloat(total_income.replace(/,/g,""));
			var count = ((value1*1000)/(value*1000))*100;
			$("#income_bl").text(formatVal1(count));
		}

	});
	function formatVal1(count) {
		if (!$.isNumeric(count))
			count = "0";
		count = ((parseFloat(count) * 10000) / 10000).toFixed(4);
// 	count = formatNumberAuto(count.toString(), 9, 2, 2);
		count = changeTwoDecimal_f(count);
		return count;
	}

	var changeTwoDecimal_f= function (floatvar){
		var f_x = parseFloat(floatvar);
		if (isNaN(f_x)){
			return '0.00';
		}
		var f_x = Math.round(f_x*100)/100;
		var s_x = f_x.toString();
		var pos_decimal = s_x.indexOf('.');
		if (pos_decimal < 0){
			pos_decimal = s_x.length;
			s_x += '.';
		}
		while (s_x.length <= pos_decimal + 2){
			s_x += '0';
		}
		return s_x;
	}
</script>